package controller;

import client.LoginClient;
import gui.LoginGUI;

public class LoginController {
	private LoginGUI gui;
	private LoginClient client;

	public LoginController(LoginGUI gui) {
		this.gui = gui;
		this.client = new LoginClient("localhost", 7764);
		
		setAction();
	}
	
	private void setAction(){
		gui.getTf_username().addKeyListener(new EnterAction(gui, client));
		gui.getTf_password().addKeyListener(new EnterAction(gui, client));

		gui.getBtn_login().addActionListener(new LoginAction(gui, client));
		gui.getBtn_exit().addActionListener(new ExitAction());
	}
	
}
